import {reqCategoryList, reqBannerList, reqFloorList} from "@/api";
const state ={
    categoryList:[],
    bannerList:[],
    floorList:[]
};

const mutations ={
    CATEGORYLIST(state,categoryList){
        state.categoryList=categoryList;
    },
    BANNERLIST(state,bannerList){
        state.bannerList=bannerList;
    },
    FLOORLIST(state,floorList){
        state.floorList=floorList;
    },
};

const actions ={
   async categoryList(a){
        let result = await reqCategoryList()
       a.commit('CATEGORYLIST', result)
    },

    async bannerList(a){
        let result = await reqBannerList()
        a.commit('BANNERLIST', result.data)
    },

    async floorList(a){
        let result = await reqFloorList()
        a.commit('FLOORLIST', result.data)
    }
};

const getters ={};

export default {
    state,
    mutations,
    actions,
    getters
}